import { setProductPrice } from '~/common'
export const columns = [{
    width: '160',
    prop: 'submitTime',
    label: '时间'
  },
  {
    width: '160',
    prop: 'errorType',
    label: '错误类型'
  },
  {
    width: '200',
    prop: 'errorContent',
    label: '错误内容',
    'show-overflow-tooltip': true
  }
];

export const shipments = [{
    width: '150',
    prop: 'shipmentsOrderId',
    label: '发货单号',
    'show-overflow-tooltip': true
  },
  {
    width: '150',
    prop: 'shipmentsTime',
    label: '发货日期'
  },
  {
    width: '120',
    prop: 'shipmentsCount',
    label: '发货数量'
  },
  {
    width: '120',
    prop: 'productLine',
    label: '生产线'
  },
  {
    width: '120',
    prop: 'totalCount',
    label: '总数量'
  },
  {
    width: '150',
    prop: 'action',
    label: '明细'
  }
];
export const listColumns = [{
  width: '50',
  type: 'selection'
  },{
    'min-width': '200',
    prop: 'orderCode',
    label: '订单编号',
    'show-overflow-tooltip': true
  },
  {
    'min-width': '200',
    prop: 'supplierName',
    label: '供应商',
    'show-overflow-tooltip': true
  },
  {
    width: '150',
    prop: 'productLineName',
    label: '产品线',
    'show-overflow-tooltip': true
  },
  {
    width: '200',
    prop: 'originalFactoryName',
    label: '生产厂家',
    'show-overflow-tooltip': true
  },
  {
    width: '100',
    prop: 'productKind',
    label: '产品种类',
    'show-overflow-tooltip': true
  }, {
    width: '100',
    prop: 'productCount',
    label: '产品数量'
  },
  {
    width: '120',
    prop: 'orderAmount',
    label: '总金额（元）',
    formatter: row => setProductPrice(row.orderAmount)
  },
  {
    width: '120',
    prop: 'paymentAmount',
    label: '实付金额',
  },
  {
    width: '120',
    prop: 'file',
    label: '付款凭证'
  },
  {
    width: '120',
    // prop: 'orderStatus2',
    label: '优惠金额',
    formatter: row => ('0.00')
  },
  {
    width: '120',
    prop: 'orderStatusName',
    label: '订单状态',
  },
  {
    width: '180',
    prop: 'commitDate',
    label: '提交时间'
  },
  {
    width: '120',
    prop: 'payUse',
    label: '支付用途',
    formatter: row => (PAYUSE_TYPE[Number(row.payUse)])
  },
  // {
  //   width: '120',
  //   prop: 'orderCodeRelate',
  //   label: '关联单号'
  // },
  {
    width: '120',
    prop: 'isDelayPay',
    label: '标签',
    formatter: row => (ISDELAYPAY_TYPE[Number(row.isDelayPay)])
  },

  {
    width: '120',
    prop: 'commitUser',
    label: '下单人',
    'show-overflow-tooltip': true
  },
  {
    width: '120',
    prop: 'orderTypeName',
    label: '订单类型',
    'show-overflow-tooltip': true
  },
  {
    width: '120',
    prop: 'payType',
    label: '支付方式',
    formatter: row => (PAY_TYPE[Number(row.payType)])
  }, {
    minWidth: '200',
    prop: 'operation',
    label: '操作',
    fixed: 'right'
  }
];
const PAY_TYPE = {
  2: '在线支付',
  1: '线下支付',
}
const PAYUSE_TYPE = {
  1: '货款',
  2: '押金',
}
const ISDELAYPAY_TYPE = {
  2: '无账期',
  1: '有账期',
}
export const tabArr = [{
    lab: '全部',
    val: 0,
    badge: {
      value: null
    }
  },
  {
    lab: '待提交',
    val: 1,
    badge: {
      value: null
    }
  },
  {
    lab: '待平台处理',
    val: 2,
    badge: {
      value: null
    }
  },
  // {
  //   lab: '待支付',
  //   val: 3,
  //   badge: {
  //     value: null
  //   }
  // },
  // {
  //   lab: '待发货',
  //   val: 4,
  //   badge: {
  //     value: null
  //   }
  // },
  {
    lab: '待收货',
    val: 5,
    badge: {
      value: null
    }
  },
  {
    lab: '部分收货',
    val: 6,
    badge: {
      value: null
    }
  },
  // {
  //   lab: '校验失败',
  //   val: 9,
  //   badge: {
  //     value: null
  //   }
  // },
  {
    lab: '已取消',
    val: 8,
    badge: {
      value: null
    }
  },
  {
    lab: '已完成',
    val: 7,
    badge: {
      value: null
    }
  },

]
